from fastecdsa import keys, curve,ecdsa
bcurve=curve.secp256k1
priv_key, pub_key = keys.gen_keypair(bcurve) 
print("private:")
print(priv_key)
print("public:")
print(pub_key)

def sign_message(message,priv_key):
    r, s = ecdsa.sign(message, priv_key, curve=bcurve)
    # must it be string or bytes?
    return r,s
def verify_message(message,pub_key,r,s):
    return ecdsa.verify((r,s),message, pub_key, curve = bcurve)

message = "content being posted"
# we simply assume the curve type is bcurve and do not even do shit over eval function.
r,s = sign_message(message,priv_key)
print(r,s)
# how to import these shits?
result = verify_message(message,pub_key,r,s)
print("valid? {}".format(result))
# you want a tempfile?
print(type(priv_key)) # int
print(type(pub_key)) # fastecdsa.point.Point
print(dir(pub_key))
x,y = pub_key.x, pub_key.y
print(x,y,bcurve, type(x), type(bcurve))
from fastecdsa import point
imported_pub_key = point.Point(x,y,curve=bcurve)
print("import_pub_key:", imported_pub_key)
result = verify_message(message,imported_pub_key,r,s)
print("valid? {}".format(result))
# now we need to store and reuse the data!
# we need to pass the thing via string.
